<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>定位的层级</title>
    <style>
        .outer {
            width: 800px;
            height: 600px;
            background-color: #888;
            border: 1px black solid;
            padding: 20px;
            position: relative;

        }

        .inner {
            width: 200px;
            height: 200px;
            font-size: 20px;
            background-color: red;
            /*定位可越过padding*/
            position: absolute;
            left: 0;
            top: 0;
        }



    </style>
</head>


<body>
<div class="outer">
    <div class="inner">inner</div>

</div>

</body>
</html>